package com.xyd.service;

import com.xyd.dao.UserDao;
import com.xyd.entity.User;
import com.xyd.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

public class UserService {
    SqlSession sqlSession = null;

    public User userLogin(User user) {
        User u = null;
        sqlSession = MybatisUtil.getSqlSession();
        try {
            u = sqlSession.getMapper(UserDao.class).userLogin(user);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            sqlSession.close();
        }
        return u;
    }

}
